<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
/* function addInput() {
    var fileDiv = document.getElementById("fileDiv");
    var br = document.createElement("br");      // 개행 생성
    var inputs = document.getElementsByTagName("input");
    var input = document.createElement("input");    // input 생성		
    var fileCnt = 0;
    for(var i = 0; i<inputs.length; i++) {
     if(inputs[i].type == "file") {
      fileCnt++;   
     	}
     	
    }
     if(fileCnt > 3){
 		document.getElementById("add").style.display = "none"; 	
 	} 
   		 input.type = "file";
   		 input.name = "list-file" + fileCnt;
  	 	 fileDiv.appendChild(input);
    		fileDiv.appendChild(br);
	return true;
} */
	function listDo(){
		var list;	
		list=confirm("작성을 취소 합니다!!.");
			if(list==true){
				if(confirm("정말로 취소할꺼야??")){
					location.href='list.do';}
			}
			return false;
	}	
	function submitDo(){
	var list;	
	list=confirm("상품을 등록합니다!!");
		if(list==true){
			document.write.submit();
		}else{
			alert("취소 되었습니다.");
		}
	}	
</script>
</head>
<body>
	<div align=center><h1>상품 등록</h1></div>
	
<form action="write.do" method="post" enctype="multipart/form-data" name="write">
<table width="1000" border="1">
	<tr height="30">
		<td>상품명: <input type="text" name="p_name"></td>
		<td>상품코드: <input type="text" name="p_code"></td>
		<td>상품 카테고리 : <select name="p_category">
						<option value="공구끼리">공구 끼리</option>
						<option value="마켓끼리">마켓 끼리</option>
					</select> 
		</td>
		<td>가격: <input type="text" name="p_price"></td>
	</tr>
	<tr height="30">
		<td colspan="3">상품 옵션1 : <input type="text" name="p_option"></td>
		<td><select name="p_valid">
			<option value="on">판 매</option>
			<option value="off">판매 대기</option>
		</select></td>	
		
	</tr>
	<tr height="30">
		<td width="50%">마일리지 : <input type="text" name="p_point"></td>
		<td>옵션 마일리지 : <input type="text" name="p_addpoint"> <font color=red>(null 가능)</font></td>
		<td width="50%"> 시간 선택 : <input type="text" name="p_time"></td>
		<td>수량 : <input type="text" name="p_amount"></td>
	</tr>
	<tr>
		<td align="center">내용</td><td colspan="3"><textarea cols="100" rows="20" name="p_content"></textarea></td>
	</tr>
	<tr height="30">
		<td>상품 목록 사진 : <input type="file" name="reportFile"><br>	</td>
		<td>상품 미리보기 사진 :   <input type="file" name="reportFile"><br>
								<input type="file" name="reportFile"><font color=red>(null 가능)</font><br>
								<input type="file" name="reportFile"><font color=red>(null 가능)</font>
		</td>
		<td colspan="2">상품 상세 사진 : <br><input type="file" name="reportFile"><br>
									  <input type="file" name="reportFile"><font color=red>(null 가능)</font><br>
									  <input type="file" name="reportFile"><font color=red>(null 가능)</font></td>
	</tr>
	<tr height="30">
		<td align="right" colspan="4"><input type="button" value="등록" onclick="submitDo()"><input type="button" onclick="return listDo()" value="취소"></td>
	</tr> 
</table><br><br><br>
</form>
</body>
</html>